package com.mdd.maduoduo.domain.interactor;

import com.mdd.maduoduo.domain.executor.PostExecutionThread;
import com.mdd.maduoduo.domain.executor.ThreadExecutor;
import com.mdd.maduoduo.domain.repository.LoginRepository;
import com.mdd.maduoduo.entity.QueryListEntity;

import java.util.HashMap;

import javax.inject.Inject;

import io.reactivex.Observable;

public class QueryListData extends UseCase<QueryListEntity, QueryListData.Params>{

    @Inject
    LoginRepository mRepository;

    @Inject
    QueryListData(ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread) {
        super(threadExecutor, postExecutionThread);
    }
    @Override
    Observable<QueryListEntity> buildUseCaseObservable(QueryListData.Params params) {
        return mRepository.queryList(params.map);
    }

    public static final class Params {
        private HashMap<String, Object> map;

        public HashMap<String, Object> getMap() {
            return map;
        }

        public void setMap(HashMap<String, Object> map) {
            this.map = map;
        }
    }
}
